package apuntes;

public class Coche {

	private String tag;
	private int coordX;
	private int coordY;
	private int longitud;
	private boolean horizontal; //1 horizontal, 0 vertical
	

	
	public Coche (String t, int x, int y, int l, boolean h){
		tag = new String(t);
		coordX = x;
		coordY = y;
		longitud = l;
		horizontal = h;
	}
	
	public Coche(Coche c){
		this(c.getTag(), c.getX(), c.getY(), c.getLongitud(), c.isHorizontal());
	}
	
	public Coche (String t){
		tag = new String(t);;
	}
		
	public void setX(int x){
		coordX = x;
	}
	
	public void setY(int y){
		coordY = y;
	}
	
	public boolean isHorizontal(){
		return horizontal;
	}
	
	public int getLongitud(){
		return longitud;
	}
	
	public int getX(){
		return coordX;
	}
	
	public int getY(){
		return coordY;
	}
	
	public String getTag(){
		return tag;
	}
	
	public String toString(){
		return "**COCHE " + tag + ": X: " + coordX + " Y: " + coordY + " Horizontal: " + horizontal + " Longitud: " + longitud;
	}
}
